<?php
declare (strict_types=1);

namespace app\backend\validate;

use think\Validate;

class WebsiteValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => 'require',
        'phone' => 'require',
        'name' => 'require',
        'address' => 'require',
        'record' => 'require',
        'copyright' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require' => 'id不能为空！',
        'phone.require' => '请输入手机号！',
        'address.require' => '请输入地址！',
        'name.require' => '请输入公司名称！',
        'record.require' => '请输入公司备案！',
        'copyright.require' => '请输入公司版权！',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'update' => ['id','address', 'phone', 'name','record','copyright']
    ];
}
